﻿
using System;
using System.Collections.Generic;
using System.Text;

using YouHP.Utility;
using YouHP.BLL;
using YouHP.Model;
using YouHP.Model.Group;

namespace YouHP.Pages.Group
{
    public class ReplyDel : YouHP.Pages.Group.GroupBasePage
    {
        protected ReplyInfo ReplyData = new ReplyInfo();
        protected override void ShowPage()
        {
            base.ShowPage();
            if (ErrorCount > 0) return;

            int rid = RequestTools.GetInt("rid", 0);
            int tid = RequestTools.GetInt("tid", 0);
            ReplyData = ReplyBLL.Instance.GetReplyInfo(rid);


            bool succ = ReplyBLL.Instance.DeleteReply(rid, tid, UserData.Id);
            if (succ == true)
            {
                this.AddMsgLine("删除成功");
                string nexturl = "/Group/Topic.aspx?gid=" + GroupData.Id + "&tid=" + ReplyData.TopicId;
                this.SetUrl(nexturl);
                this.SetMetaRefresh();
            }
            else
            {
                this.AddErrLine("删除失败");
                return;
            }
        }
    }
}